import 'dart:convert';

import '../generated/json/base/json_field.dart';
import '../generated/json/book_entity.g.dart';


@JsonSerializable()
class BookEntity{

  String? no;

  String? place;

  @JSONField(name: "state_value")
  String? stateValue;

  String? isbn;

  @JSONField(name: "main_title")
  String? mainTitle;

  String? author;

  @JSONField(name: "search_no")
  String? searchNo;
  @JSONField(name: "place_name")
  String? placeName;
  @JSONField(name: "place_no")
  String? placeNo;

  String? subject;

  String? publisher;

  @JSONField(name: "publish_date")
  String? publishDate;

  String? price;

  String? pages;

  bool expand = false;

  String? cover;

  String? summary;

  //0在馆
  //1外借
  //-1待查询
  //-2未知
  int? status = -1;

  //0 = 待上架
  //1 = 已上架
  //-1 = 上架失败
  int stackStatus = 0;

  //最终状态
  //0在架
  //1外借
  //2缺失
  //3错架
  //4未知
  int? result = 4;
  bool hasApi = false;
  bool hasRfid = false;


  BookEntity();

  factory BookEntity.fromJson(Map<String, dynamic> json) => $BookEntityFromJson(json);

  Map<String, dynamic> toJson() => $BookEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}



